/**
 * 
 */
package br.ufal.ic.sd.project.server.core;

import java.util.Collection;
import java.util.Vector;

/**
 * @author keven andrade
 *
 */
public class TokenListener {
    
    private Collection<Server> entities;
    
    /**
     * Constructor
     */
    public TokenListener(){
	this.entities = new Vector<Server>();
    }
    
    /**
     * @return the entities
     */
    public Collection<Server> getEntities() {
        return entities;
    }

    /**
     * @param entities the entities to set
     */
    public void setEntities(Collection<Server> entities) {
        this.entities = entities;
    }



    public void notifyTokensOn(){
	
	for(Server objServer : this.entities){
	    objServer.setTokenStateOn();
	}
    }
    
    public void notifyTokensOff(){
	
	for(Server objServer: this.entities){
	    objServer.setTokenStateOff();
	}
    }
    
    public void addEntity(Server objServer){
	this.entities.add(objServer);
    }
    
}
